package com.pai4j.ugc;

import com.pai4j.common.util.SpringContextUtil;
import com.pai4j.ugc.messaegqueue.consumer.redis.MomentPublishRedisMQConsumer;
import com.pai4j.ugc.messaegqueue.consumer.redis.PersistentChatMessageRedisMQConsumer;
import com.pai4j.ugc.messaegqueue.consumer.redis.PersistentInteractionMessageRedisMQConsumer;
import com.pai4j.ugc.messaegqueue.consumer.redis.RefreshChattingRedisMQConsumer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan("com.pai4j")
@EnableFeignClients("com.pai4j.remote")
public class Pai4jUGCApplication {

    public static void main(String[] args) {

        SpringApplication.run(Pai4jUGCApplication.class, args);

        /**
         * 启动Redis MQ
         */
        SpringContextUtil.getBean(RefreshChattingRedisMQConsumer.class).initBean();
        SpringContextUtil.getBean(PersistentChatMessageRedisMQConsumer.class).initBean();
        SpringContextUtil.getBean(MomentPublishRedisMQConsumer.class).initBean();
        SpringContextUtil.getBean(PersistentInteractionMessageRedisMQConsumer.class).initBean();
    }

}
